#ifndef _RETRO_COLORSLIDER
#define _RETRO_COLORSLIDER

namespace Retro
{
  namespace Creator
  {
    namespace GUI
    {
      enum ColorSliderNotifyEvent
      {
        ColorSliderNotifySelection = 0x0001,
      };

      enum ColorSliderMode
      {
        ColorSliderAlpha,
        ColorSliderValue,
      };

      class ColorSlider : public Control
      {
      private:
        Geom::RGBColor  mRGBColor;
        Geom::HSVColor  mHSVColor;
        UIState         mState;
        ColorSliderMode mMode;
        INT             mValue;

        VOID  getValueBounds(Gdip::Rect& oBounds);
        VOID  getValueCursorBounds(Gdip::Rect& oBounds);
        BOOL  hitTestValue(const Geom::Point& iPoint);

      protected:
        virtual VOID  onControlPaint(ControlPaintEvent& iEvent);
        virtual VOID  onMouseDown(Event::MouseEvent& iEvent);
        virtual VOID  onMouseUp(Event::MouseEvent& iEvent);
        virtual VOID  onMouseMove(Event::MouseEvent& iEvent);
        virtual VOID  onMouseWheel(Event::MouseWheelEvent& iEvent);
        virtual VOID  onKeyDown(Event::KeyEvent& iEvent);
        virtual VOID  onFocus(Event::FocusEvent& iEvent);

      public:
        INL ColorSliderMode getMode()
        {
          return mMode;
        }

        INL VOID  setMode(ColorSliderMode iValue)
        {
          mMode = iValue;
          invalidate();
        }

        INL INT   getValue()
        {
          return mValue;
        }

        VOID  setValue(INT iValue);

        INL Geom::RGBColor  getColorRGB()
        {
          return mRGBColor;
        }

        INL Geom::HSVColor  getColorHSV()
        {
          return mHSVColor;
        }

        VOID  setColor(COLOR iValue);

        ColorSlider();
      };
    } // namespace GUI
  } // namespace Creator
} // namespace Retro

#endif